package io.gitee.hchaojie.day05;

import org.junit.Test;

import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.Arrays;
import java.util.List;

public class DemoFile {
    @Test
    public void test() throws IOException {
        List<String> strings = Files.readAllLines(Paths.get("data/sentence.txt"));

        System.out.println(strings.get(0));
    }

    @Test
    public void test2() {
        String str = "abc!gh, bb; f.";

        // String[] words = str.split("[!?',; ]");
        String[] words = str.split("[,. !]");

        for (String s : words) {
            System.out.println(s + " / " + s.length());
        }
        
        
        System.out.println(words.length);
    }
}
